package Spring5.第二章.demo2_4_原型模式.浅克隆;

import java.util.List;

public class ContcretePrototypeA implements Prototype {
    private int age;
    private String name;
    private List hobbies;

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public List getHobbies() {
        return hobbies;
    }

    public void setHobbies(List hobbies) {
        this.hobbies = hobbies;
    }

    @Override
    public Prototype clone() {
        ContcretePrototypeA contcretePrototypeA = new ContcretePrototypeA();
        contcretePrototypeA.setAge(this.age);
        contcretePrototypeA.setName(this.name);
        contcretePrototypeA.setHobbies(this.hobbies);
        return contcretePrototypeA;
    }
}
